#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int factorsum(int number);
void PrintPN(int m, int n);

int main()
{
	int m, n;

	scanf("%d %d", &m, &n);
	if (factorsum(m) == m) printf("%d is a perfect number\n", m);
	if (factorsum(n) == n) printf("%d is a perfect number\n", n);
	PrintPN(m, n);

	return 0;
}
int factorsum(int number)
{

	int a = number;
	for (int i = 1; i<number; i++){
		if (number%i == 0) a -= i;
	}
	if (a == 0) return number;
	else return number - a;

};
void PrintPN(int m, int n)
{
	int fla = 0;
	for (int i = m; i <= n; i++){
		if (factorsum(i) == i)
		{
			fla = 1;
			printf("%d = 1", i);

			for (int j = 2; j<i; j++)
			{
				if (i%j == 0) printf(" + %d", j);
			}
			printf("\n");
		}
	}
	if (fla != 1) printf("No perfect number");
};